-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve stubs with minor fixes #1038
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PIG208
force-pushed
the
fixes
branch
2 times, most recently
from
July 1, 2022 16:53
91b581a
to
ec66dfc
Compare
This makes sure that we don't reject tuples, which is also valid according to the implementation. Relevant source code: https://github.com/django/django/blob/03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72/django/db/models/sql/where.py#L271-L281 https://github.com/django/django/blob/03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72/django/db/models/sql/query.py#L2307-L2308 Signed-off-by: Zixuan James Li <[email protected]>
According to the documentation, `test_func` is a callable that takes a `User` (possibly anonymous). Relevant documentation: https://docs.djangoproject.com/en/4.0/topics/auth/default/#django.contrib.auth.decorators.user_passes_test Signed-off-by: Zixuan James Li <[email protected]>
Though not documented, it's possible for `dirs` to contain `pathlib.Path`. `django.template.loaders.app_directories.Loader` is an example for this: https://github.com/django/django/blob/03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72/django/template/loaders/app_directories.py https://github.com/django/django/blob/03eec9ff6cc78e7c1bcf88bb76ecd11f0d433c72/django/template/utils.py#L97-L111 Signed-off-by: Zixuan James Li <[email protected]>
Hi! Can you please fix linter errors? |
There are several serve functions that should return a `FileResponse`. Source code: https://github.com/django/django/blob/863aa7541d30247e7eb7a973ff68a7d36f16dc02/django/views/static.py#L17-L53 https://github.com/django/django/blob/863aa7541d30247e7eb7a973ff68a7d36f16dc02/django/contrib/staticfiles/views.py#L15-L39 https://github.com/django/django/blob/863aa7541d30247e7eb7a973ff68a7d36f16dc02/django/contrib/staticfiles/handlers.py#L48-L50 https://github.com/django/django/blob/863aa7541d30247e7eb7a973ff68a7d36f16dc02/django/test/testcases.py#L1680-L1687 Signed-off-by: Zixuan James Li <[email protected]>
Fixed! |
sobolevn
approved these changes
Jul 4, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
@@ -202,7 +202,7 @@ class FSFilesHandler(WSGIHandler): | |||
base_url: Any = ... | |||
def __init__(self, application: Any) -> None: ... | |||
def file_path(self, url: Any): ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for future: this class can be improved further.
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 18, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 19, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 21, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 21, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 21, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 22, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 22, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
PIG208
added a commit
to PIG208/zulip
that referenced
this pull request
Jul 25, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
timabbott
pushed a commit
to zulip/zulip
that referenced
this pull request
Jul 27, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
Khushiyant
pushed a commit
to Khushiyant/zulip
that referenced
this pull request
Jul 29, 2022
This is a follow-up to typeddjango/django-stubs#1038. Signed-off-by: Zixuan James Li <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have made things!
Made a series of changes according to the documentation and the source code of Django. References are in the commit messages.
Related issues
None